# $Id: PKGBUILD 167971 2012-10-04 13:11:46Z juergen $
# Maintainer: juergen <juergen@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=metalog
pkgver=3.0
pkgrel=0
pkgdesc="Metalog is a modern replacement for syslogd and klogd"
url="http://metalog.sourceforge.net"
license=('GPL')
arch=('i686' 'x86_64')
depends=('pcre')
provides=('logger')
backup=('etc/metalog.conf' 'etc/conf.d/metalog')
source=("http://sourceforge.net/projects/metalog/files/metalog-3.tar.xz/download" 'metalog' 'metalog.confd'  'metalog.service')
md5sums=('6fe404e49764fa24108fd090417bacb5'
         '9e73301a7f0be291749ee30638527cb9'
         '86bccd5a02996921e29eff8a0394d11f'
         'f005e6970c25bfdaf0596791e9135f98')

build() {
  cd $srcdir/$pkgname-3
  ./configure --prefix=/usr --sysconfdir=/etc
  make
}

package() {
  cd $srcdir/$pkgname-3
  make DESTDIR=$pkgdir install
  install -D -m755 $srcdir/metalog $pkgdir/etc/rc.d/metalog
  install -D -m644 $srcdir/metalog.confd $pkgdir/etc/conf.d/metalog
  install -D -m644 metalog.conf $pkgdir/etc/metalog.conf

  install -d "${pkgdir}"/usr/lib/systemd/system
  install -Dm644 "${srcdir}"/metalog.service "${pkgdir}"/usr/lib/systemd/system/
}
